<!DOCTYPE HTML><html><head><meta charset="utf-8"><meta name="viewport" content="maximum-scale=1,minimum-scale=1,user-scalable=0,width=device-width,initial-scale=1"><meta name="format-detection" content="telephone=no,email=no,date=no,address=no"><link rel="stylesheet" href="../../../global/css/aui.css"><link rel="stylesheet" href="../../../global/css/my-css.css"><style>.duration {
            position: absolute;
            right: .3rem;
            bottom: .15rem;
            color: #fff;
            font-size: .5rem;
        }
        .play {
            background: url(./../../../global/image/play.png) no-repeat center;
            background-size: 1.25rem;
            width: 100%;
            height: 100%;
            position: absolute;
            top: 0;left: 0;
            z-index: 99;
        }</style></head><body><div id="main" class="p-b10"></div><div id="no-msg" class="aui-hide"><span class="aui-iconfont aui-icon-comment"></span></div></body><script id="tpl-push-person" type="text/x-dot-template">{{~it :v:i}}
    <div class="bg-white p-t10 p-b10 p-l15 p-r15 m-b10">
        <div class="flex align-center" onclick="views.openUCenterWin({{=v.idol_id}}, &quot;{{=escapeStr(decodeEmoji(v.idol_name))}}&quot;);">
            <div class="auix-avatar-big aui-card-list-user-avatar">
                <img src="{{=v.follow_user_img_url}}" class="w-50 h-50 r100" />
            </div>
            <div class="s-16 c-0">
                {{=decodeEmoji(v.idol_name)}}
                <div class="c-9 s-12">{{=vdate4Msg(v.post_time)}}</div>
            </div>
        </div>
        <div data-time="{{=v.post_time}}" data-fid="" data-tid="{{=v.post_id}}" data-from="focusPerson" tapmode onclick="ccn() && views.openPostFromList(this);">
            <div class="flex between align-center m-t5 s-15 c-3 p-b10">
                <div class="aui-ellipsis-3 t-justify m-r5">
                    {{=decodeEmoji(v.title)}}
                    <span class="c-blue">查看全文></span>
                </div>
                {{? v.post_img}}
                <div class="flex-shrink relative">
                    <img src="{{=v.post_img}}" class="w-80 h-70" />
                    {{? v.duration}}
                        <div class="play"></div>
                        <div class="duration">{{=fmtSecond(v.duration)}}</div>
                    {{?}}
                </div>
                {{?}}
            </div>
            <div class="flex between b-te5 p-t10">
                 <div tapmode onclick="threadShare(event);" data-tid="{{=v.post_id}}" class="flex align-center w-full j-center">
                    <img class="w-14" src="../../../global/image/icon/icon-share.png" alt=""/>
                    <div class="m-l3 c-6">{{=v.forward_count}}</div>
                </div>
                <div tapmode onclick="threadLiked(event);" data-tid="{{=v.post_id}}" class="flex align-center w-full j-center">
                    <img class="w-14 auix-icon-zan" src="../../../global/image/icon/icon-zan{{=v.liked?'-active':''}}.png" alt=""/>
                    <div class="m-l3 c-6 {{=v.liked?'c-red-active':'c-6'}} lauds-num">{{=v.like_count}}</div>
                </div>
                <div class="flex align-center w-full j-center">
                    <img class="w-14" src="../../../global/image/icon/icon-comment.png" alt=""/>
                    <div class="m-l3 c-6">{{=v.comment_count}}</div>
                </div>
            </div>
        </div>
    </div>
    {{~}}</script><script src="../../../config.js"></script><script src="../../../global/script/lib/api.js"></script><script src="../../../global/script/lib/doT.min.js"></script><script src="../../../global/script/mylib.js"></script><script src="../../../app.js"></script><script type="text/javascript">apiready = function() {
        window.app.init4Frm();
        window.start = 0;
        initFocus(window.start,cfg.lauders_one_load);
        addPageLoading();
        loadMore();
        bindRefreshFeed();
    };

    function initFocus(start,size,check){
        var uid = app.auth.getMyId();
        var data = {
            uid: parseInt(uid),
            page_context: size,
            last_id: start,
        };
        gateway_msg_center('get_focus_posting_message_list', data, {
            always: function(){
                rmPageLoading();
                rmFooterLoading();
                utils.setRefreshDone();
                if(check){
                    $api.byId('main').innerHTML = '';
                }
            },
            succ: function (json) {
                // if (json.data.list.length < 20) {
                //     window.start = -1;
                // }
                window.start = json.data.last_id==0 ? -1 : json.data.last_id;
                // var html = doT_Render('#tpl-follow', json.data.list);
                // $api.append($api.byId('main'), html);
                // for(var i=0;i<json.data.list.length;i++){
                //     json.data.list[i].post_time = vdate4Msg((new Date(json.data.list[i].post_time).getTime())/1000);
                // }
                var html = doT_Render('#tpl-push-person', json.data.list);
                $api.append($api.byId('main'), html);

                // 更新消息页面红点
                utils.notifyRefreshMsgUnreads({from: 'focusPerson'});
            },
            fail: function (err, url) {
                utils.postErrWithTipsEx(err, url, data);
            }
        });
    }

    function fooPushLaud() {
        var html = doT_Render('#tpl-push-person', mockLaudList);
        $api.append($api.byId('main'), html)
        sofast(); // 优化 tapmode
    }

    function loadMore(){
        listenToScrollToBottom(function(ret, err) {
            if (window.start >= 0) {
                // window.start++;
                addFooterLoading();
                // initFocus(window.start * 20,cfg.lauders_one_load);
                initFocus(window.start,cfg.lauders_one_load);
            }
        });
    }
    function bindRefreshFeed() {
        utils.bindPullRefresh(function(onDone) {
            window.start = 0;
            initFocus(window.start,cfg.lauders_one_load,1);
        });
    }
    // 帖子分享
    function threadShare(ev){
        var el = ev.currentTarget;
        var event = ev || event;
        event.stopPropagation();
        event.preventDefault();

        var tid = $api.attr(el, "data-tid");

        if (!obj_being(tid) || tid <= 0) {
            return;
        }

        var q = {
            action: 'getThreadShare',// emmm，跟热文分享一样的
            tid: tid,
            from: 'timeline',
        };
        utils.loading();
        std_ajax_get('wuchen/api/share.php', q, {
            always:function(){
                utils.rmLoading();
            },
            succ: function(json) {
                json.openfrom = q.from;
                prepareShare(json);
            },
            fail: function(err, url) {
                utils.postErrWithTips(err, url);
            }
        });

    }
    // 帖子点赞
    function threadLiked(ev){
        var el = ev.currentTarget;
        var event = ev || event;
        event.stopPropagation();
        event.preventDefault();
        onLoginDo(function() {
            var laud = $api.dom(el, '.auix-icon-zan');
            var elNum = $api.dom(el, '.lauds-num');
            var doLaud = !isLauded(el);
            var landTid = $api.attr(el, 'data-tid');
            // var authorid = $api.attr(el, 'data-authorid');
            // var userData = app.auth.getUserData();
            // 查无此需求.........
            // if (parseInt(authorid) == parseInt(userData.uid)) {
            //     //自己的评论点不了赞
            //     return;
            // }
            if (doLaud) {
                // increLauded(laud);
                $api.attr(laud, 'src', '../../../global/image/icon/icon-zan-active.png');
                $api.addCls(elNum,'c-red-active');
                elNum.innerHTML = parseInt(elNum.innerHTML) > 0 ? (parseInt(elNum.innerHTML) + 1) : 1;
                var doState  =  'add';
            }else {
                $api.attr(laud, 'src', '../../../global/image/icon/icon-zan.png');
                $api.removeCls(elNum,'c-red-active');
                elNum.innerHTML = parseInt(elNum.innerHTML) > 0 ? (parseInt(elNum.innerHTML) - 1) : 0;
                var doState = 'sub';
            }

            startLand(doState,landTid);
        });
    }

    // 异步处理点赞事件
    function isLauded(el) {
        var img = $api.dom(el, "img");
        return $api.attr(img, 'src').indexOf('icon-zan-active.png') > -1;
    }
        // 触发点赞 或者 取消点赞
    function startLand(doState,landTid){
        var q = {
            module: 'recommend',
            //do: landChangeState == 1 ? 'add' : 'sub',
            do:doState,
            hash: cfg.formhash,
            tid: landTid
        };

        var data = {
            method: 'ajax_get',
            url: cfg.dz_api,
            query: q,
            success: 'post_laud_success_callback',
            fail: 'post_laud_fail_callback'
        };


        var js = makeExecScriptCallee('addAsyncRequest', data);
        api.execScript({
            name: 'root',
            script: js
        });
    }</script></html>